function _R.Entity:WPP_SetUsed( Bool )
	if ( !self.WPP ) then return end
	self.WPP.Used = Bool
end

hook.Add("WPP_SetUsed","WPP",function(Entity,Bool)
	Entity:WPP_SetUsed( Bool )
	if ( SERVER ) then
		umsg.Start( "WPP_SetUsed" )
			umsg.Entity( self )
			umsg.Bool( Bool )
		umsg.End()
	end
end)

if ( CLIENT ) then

	usermessage.Hook("WPP_SetUsed",function(um) hook.Call("WPP_SetUsed",GAMEMODE,um:ReadEntity(),um:ReadBool()) end)
	
end

function _R.Entity:WPP_TTD() //Time Till Death
	if ( !self:WPP_IsOwned() ) then return -1 end
	if ( self.WPP.Used ) then return -1 end
	
	local N = GetConVarNumber("wpp_auto_remove")
	if ( N > 1 ) then return -1 end
	local Die = N - self:WPP_Age()
	if ( N <= 0 ) then return 0 end
	return N
end

if ( SERVER ) then
	local LS = 0
	
	hook.Add("Think","WPP",function()
		if ( GetConVarNumber("wpp_auto_remove") > 0 ) and ( CurTime() > LS ) then
			for _,Entity in pairs( ents.GetAll() ) do
				if ( Entity:WPP_TTD() == 0 ) then Entity:Remove() end
			end
		end
	end)
end
